﻿@model GradeModel
@{
    ViewBag.Title = "Check";
}
<main aria-labelledby="title">
    <h2 id="title">@ViewBag.Title</h2>
    <h3>@ViewBag.Message</h3>


    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        <div class="form-control">
            @Html.LabelFor(model => model.成绩.学号, new { @id = "gettingStartedTitle" })
            @Html.TextBoxFor(model => model.成绩.学号, new { @class = "form-control" })
            <button type="submit" class="btn btn-primary">查询</button>
        </div>
    }

    @if (string.IsNullOrEmpty(ViewBag.ErrorMessage))
    {
        // 如果有查询请求，则显示返回结果的表格
        <h2>查询结果：</h2>
        <table class="table">
            <thead>
                <tr>
                    <th>
                        @Html.DisplayNameFor(model => model.成绩.学号)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.成绩.姓名)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.成绩.习题成绩)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.成绩.测试成绩)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.成绩.考试成绩)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.成绩.总成绩)
                    </th>
                </tr>
            </thead>

            <tbody>
                <tr>
                    <td>
                        @Html.DisplayFor(model => Model.成绩.学号)
                    </td>
                    <td>
                        @Html.DisplayFor(model => Model.成绩.姓名)
                    </td>
                    <td>
                        @Html.DisplayFor(model => Model.成绩.习题成绩)
                    </td>
                    <td>
                        @Html.DisplayFor(model => Model.成绩.测试成绩)
                    </td>
                    <td>
                        @Html.DisplayFor(model => Model.成绩.考试成绩)
                    </td>
                    <td>
                        @Html.DisplayFor(model => Model.成绩.总成绩)
                    </td>
                </tr>
            </tbody>
        </table>

        <table class="table">
            <thead>
                <tr>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题1)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题2)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题3)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题4)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题5)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题6)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题7)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题8)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题9)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题10)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题11)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题12)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题13)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题14)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题15)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.习题.习题16)
                    </th>
                </tr>
            </thead>

            <tbody>
                <tr>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题1)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题2)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题3)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题4)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题5)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题6)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题7)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题8)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题9)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题10)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题11)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题12)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题13)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题14)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题15)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.习题.习题16)
                    </td>
                </tr>
            </tbody>
        </table>

        <table class="table">
            <thead>
                <tr>
                    <th>
                        @Html.DisplayNameFor(model => model.测试.测试1)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.测试.测试2)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.测试.测试3)
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        @Html.DisplayFor(model => model.测试.测试1)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.测试.测试2)
                    </td>
                    <td>
                        @Html.DisplayFor(model => model.测试.测试3)
                    </td>
                </tr>
            </tbody>
        </table>
    }
    else
    {
        <div class="alert alert-danger">@ViewBag.ErrorMessage</div>
    }
    @*<address>
            One Microsoft Way<br />
            Redmond, WA 98052-6399<br />
            <abbr title="Phone">P:</abbr>
            425.555.0100
        </address>*@

    @*<address>
            <strong>Support:</strong>   <a href="mailto:Support@example.com">Support@example.com</a><br />
            <strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a>
        </address>*@
</main>